Fixed off-by-one in collision with walls.