Fix bug: correctly determine if parsing errors occurred or not

Rename `debug` argument