ann.py: Further improvements.