Fix bug in APKG export
Merge pull request #609 from timrae/apkgExportFix

Fix bug in APKG export