Move HashPSQ to internal module, fix couple of bugs