Fix pathname issues during compilation, and explicitly quit with error if compilation failed.