merged patch #6876 manually, taking care of poDemon
merged patch #6876 manually, taking care of poDemon

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