bytes unit tests and fixes