Fixed external implementation for private types (#578).
Merge pull request #613 from iskiselev/PrivateExternalImplementation_Issue578

Fixed external implementation for private types (#578).