destroy dialog when closed (fix annoying repositioning when reopened), various fixes
Merge branch 'master' into gh-pages