Improve file syntax detection