Fix index and cleanup