Cell reference/index cleanup with tests