Fix some test issues, extend test to allow binary files, fix no semicolon before end in some cases.