Fix a few parsing bugs