Updated format_a.py to detect and fix formatting errors