Fix a double delete and control usage of proof