diff --git a/setup/cli/package.php b/setup/cli/package.php
index 9b5ecae51e212cc570b220c36b75935f75b79b93..67d20a32b5d8bbcc7f232c2f7392430a232e99da 100755
--- a/setup/cli/package.php
+++ b/setup/cli/package.php
@@ -21,7 +21,7 @@ function get_osticket_root_path() {
 function glob_recursive($pattern, $flags = 0) {
     $files = glob($pattern, $flags);
     foreach (glob(dirname($pattern).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir) {
-        $files = array_merge($files, 
+        $files = array_merge($files,
             glob_recursive($dir.'/'.basename($pattern), $flags));
     }
     return $files;
@@ -89,22 +89,23 @@ package("*.php", 'upload/');
 foreach (array('assets','css','images','js') as $dir)
     package("$dir/*", "upload/$dir", -1, "*less");
 
+# Load API
+package('api/{,.}*', 'upload/api');
+
 # Load the knowledgebase
 package("kb/*.php", "upload/kb");
 
 # Load the staff interface
 package("scp/*.php", "upload/scp/", -1);
 foreach (array('css','images','js') as $dir)
-    package("$dir/*", "upload/scp/$dir", -1);
+    package("scp/$dir/*", "upload/scp/$dir", -1);
 
 # Load in the scripts
 mkdir("$stage_path/scripts/");
 package("setup/scripts/*", "scripts/", -1, "*stage");
 
 # Load the heart of the system
-package("include/*.php", "upload/include", -1);
-# And the sql patches
-package("include/upgrader/*.sql", "upload/include/upgrader", -1);
+package("include/{,.}*", "upload/include", -1, array('*ost-config.php', '*.sw[a-z]'));
 
 # Include the installer
 package("setup/*.{php,txt}", "upload/setup", -1, array("*scripts","*test","*stage"));
@@ -130,8 +131,8 @@ foreach ($version_info as $line)
 
 $pwd = getcwd();
 chdir($stage_path);
-shell_exec("tar cjf '$pwd/osticket-".THIS_VERSION.".tar.bz2' *");
-shell_exec("zip -r '$pwd/osticket-".THIS_VERSION.".zip' *");
+shell_exec("tar cjf '$pwd/osTicket-".THIS_VERSION.".tar.bz2' *");
+shell_exec("zip -r '$pwd/osTicket-".THIS_VERSION.".zip' *");
 
 chdir($pwd);
 ?>