Fix issue with detecting unbalanced quotes. Identified by issue #4