Finally fixed resource deletion (and crashing)