throw exception when metadata is bad
improve invalid metadata test
2.0.1