Improve reliability of determining .exe type