hash type is now configurable; various cleanups and additional error messages