Fix bug in ParseHash

(It was throwing the wrong exception when the hash was too short.)