Fix twopane menu handling and dialog issues