Dialog class and minor changes in other code