coding fix for binary data from djmitche <https://github.com/djmitche>