Bugfixes + support for compound indexes