Fixed issue with bytearray conversion