Fix possible NPE.
Clean up code.
Merge pull request #1565 from jburel/rebased/develop/open-browser

Open browser (rebased onto develop)