Wasn't deleting layers properly.