Fixes a brainfart in position checking code