Modified byte_to_binary.
Fixed bug in encoder.