fix #6264 and #6141 (#6884)
fix #6264 and #6141 (#6884)


dom96/Nim,russpowers/Nim,russpowers/Nim,russpowers/Nim,dom96/Nim,dom96/Nim,russpowers/Nim,russpowers/Nim,dom96/Nim,dom96/Nim,russpowers/Nim,russpowers/Nim,dom96/Nim,dom96/Nim