Fixed r-tree search logic. Refactored index header printing. Some formatting.