Improve compilation detection