Fix: main parsing code failed to detect some errors