Fix conversion to byte[]