Fixed problem with python3 and binary files writing