Bugfixes in R-tree