Fixed non-modal dialog crashing on 'OK'.