Fixed some parsing bugs