Fix wrong return type for hash func