small changes to error handling in parse.py