Removing unnecessary if-index update figured out during unit-testing