Fix for issue #6

Fixes issue #6 - operator precedence
Also has minor other updates. Hopefully doesn't break anyone's code =P