Fixes parsing issues

hi @yepher - was taking a look at this project and noticed a bunch of parsing issues. hope this helps!