diff --git a/zipcart.module b/zipcart.module
index 45708b9..278abb4 100644
--- a/zipcart.module
+++ b/zipcart.module
@@ -60,12 +60,12 @@ function zipcart_init() {
  * Implementation of hook_theme().
  */
 function zipcart_theme($existing, $type, $theme, $path) {
+
   return array(
     'zipcart_block_downloads' => array(
-      'template' => 'zipcart-block-downloads',
       'arguments' => array(
-        'count' => ( !empty($_SESSION['zipcart']['files']) ) ? sizeof($_SESSION['zipcart']['files']) : 0,
-        'files' => ( !empty($_SESSION['zipcart']['files']) ) ? $_SESSION['zipcart']['files'] : NULL,
+        'count' => 0,
+        'files' => NULL,
       ),
     ),
     'zipcart_download' => array(
@@ -104,7 +104,7 @@ function zipcart_block($op='list', $delta=0, $edit=array()) {
           case '0':
             $block = array(
               'subject' => t('My Downloads'),
-              'content' => theme('zipcart_block_downloads'),
+              'content' => zipcart_block_content(),
             );
             return $block ;
         }
@@ -116,6 +116,13 @@ function zipcart_block($op='list', $delta=0, $edit=array()) {
   }
 }
 
+function zipcart_block_content() {
+   return theme('zipcart_block_downloads',
+               ( !empty($_SESSION['zipcart']['files']) ) ? count($_SESSION['zipcart']['files']) : 0,
+               ( !empty($_SESSION['zipcart']['files']) ) ? $_SESSION['zipcart']['files'] : NULL
+          );
+}
+
 /**
  * Implementation of hook_file_download.
  */
@@ -201,7 +208,7 @@ function zipcart_add_file_to_cart($ajax = FALSE) {
     'result' => $success,
   ) ;
   if ( $ajax ) {
-    die(drupal_json($result));
+    return drupal_json($result);
   }
   else {
     if ( $success ) {
@@ -252,7 +259,7 @@ function zipcart_get_zip() {
  * You can add files.
  * You can filter files.
  */
-function zipcart_filterzip(&$files) {
+function zipcart_filterzip($files) {
   // don't ever share these files
   // $excluded = array( 'sites/.*settings.*php' ) ;
   // only ever include these files 
@@ -306,8 +313,12 @@ function _zipcart_phpzip($files) {
         if ( stristr($header, 'Content-Disposition:') === 0 ) {
           unset($headers[$k]) ;
         }
+        if ( stristr($header, 'Content-Type:') === 0 ) {
+          unset($headers[$k]) ;
+        }
       }
     }
+    $headers[] = 'Content-Type: application/zip';
     $headers[] = 'Content-Disposition: attachment; filename="'. _zipcart_zip_filename() .'"' ;
     // FIXME: it would be nice to wait until the file transfer completes before we clear the 
     // files out of the session. However, if we do that, the user can't add new files to their
@@ -372,3 +383,4 @@ function _zipcart_remove_zip($filename) {
   unlink($filename);
 }
         
+
