fix case consistency with decoding/encoding
remove type conversion. only bytesstring can be used now