Readded boundary checking on obstacles.