Use try except around hash function. Fixes #74.