Fixed $DB->record_exists and $DB->delete_records to use arrays