Check default shell for validity, other minor improvements.