Improved error messages and paren counter

Parenthesis counter will now catch unpaired ) earlier on, and won't
allow parenthesis in incorrect order to fool it - ")(" will no longer be
allowed.