Fix for hex sometimes returning too many hex bytes.