Fix bug #2; improve error reports; add parsing error test