Unused variable removed.
Dialog cleanup, renamed some variables etc.