Improve compilation error handling