Fixed deleting ROIs and simplified code