Tweak invoke_browser to better handle Windows - still not tested on a Mac