Fix database cleanup dry run issues

Fix `--dry-run`