Error handling, lexem positioning and other.

Changes in error handling, more accurate lexem positioning, detection of
text beyond the main rule.