Fix detection of errors when compiling