Check if file is binary (when expected)
Code cleanup