fixed mistakes in detect_shell_version and elsewhere