improve handling of potentially null hashes