Fixes for bytestring handling
Fixed tests