Improve binary detection