One problem was that I was using integers instead of floats for the quadtree. Fixed now.