Fix database cleanup dry run issues