Store the hash rather than compute every time, plus added couple more asserts