Preliminary work on not overriding window hash in certain cases.
Miscellaneous fixes