A few bug fixes related to cmdlines.