Fix "Private type in exported type signature" warnings

See #2044