Fixed bug in binary hdr write
Fixed binary output, fully implemented now...