Dialog cleanup

Same as before. Making the pull request for this updated branch instead.