Fixes in polyglot hash calculation