Changed low level implementation for better handling of string/bytes

See #24, #26