Fix a few bugs in various commands.