Fix bug in setPositions()