Code generation for protected types. Issue #71
Fixes for protected types in packages. Issue #71