fix some simple parsing bugs