Hash checking + minor cleanups