First commit
Fixes some bugs in generatepkg.