Fixed a bug where duplicate metadata could be defined when the case didn't match.
Fixed a bug where an incorrect error message was being output.