Fixed IsPathClear to work properly for diagonal moves