Some fixes to delete.php to prevent non-admin users to deleete data