Fix erroneous conversion to signed int

Authored by broulik on Oct 7 2019, 5:06 PM.