Fixing issue #21 and possibly other parser bugs