Fixes bug in error parsing and regression test