Added check for metadata key containing question mark, plus a test.