Corrected errors for safe delete