Made sure that remaining uses of sector indices are safe to be kept and deleted a few redundant functions.