Merge "Fix crash caused by toHex returning exception"