Fixed error correction bug. Added history for ParserHead in debugging mode.