improved compilation error handling