Fix particular bug that occurs when validating metadata with constraints.

This should be merged to geonetwork develop