check: Fix a check --repair issue and added more tests