Fixed several memory leak issues and added code for printing human-readable messages upon parsing errors.