Fix some export bugs.