Handle auto-determination of mode better. Specifically, it used to fail if __progname contained a slash, even if the last component's name was apppropriate.