Fixed bugs in packaging scripts