Fixed some of the logic causing parsing to fail