Fixes getPosition logic. Especially use Math.round.