added new tests for indmap, and fixed a bug in indmap