Rebuilt test database. Fixed various index-related issues.

All 570u, 317/331i tests pass (See #19).