IndexManager related code cleanups, small fixes and such