Fix 500 error when deleting apps or tasks from web interface