Fix some parsing precedence bugs
Added test