Fix various issues with dialog usage