Add missing exports and minor rearrangements