Bugfixes in package building process