Improve build error detection