Improve error-handling of GetHash

Signed-off-by: Sven Strickroth <email@cs-ware.de>