various bugfixes, indexing should now work