Use "cmd" consistently for commands
Fix typo in repairDatabase :P and add a test