Added index type as argument. Fixed the unit test suites.