Fixes printing of errors