Adding fixes for directory ownership
Fixing template to support export