Quad tree bugs fixed, plus optimizaton