Add some checks to ensure supplied hashes are valid.