Issue #22 resolved. Some code cleaned up in Dialog.py as well