Fix for variable-length hex representation