some minor fixes
optimize intersect checking with sphere