Fix openGui. Closes #342