     {:pix pix :tags (dissoc tags "StartTime-ms")}))
     
 (defn make-multicamera-events [event]
-  (let [num-camera-channels (core getNumberOfCameraChannels)]
+  (let [num-camera-channels (long (core getNumberOfCameraChannels))]
     (for [camera-channel (range num-camera-channels)]
       (let [super-channel-index (+ camera-channel (* num-camera-channels (event :channel-index)))]
         (assoc event :channel-index super-channel-index

                                  this-time (System/currentTimeMillis)
                                  dt (- 33 (- this-time last-time))]                      
                              (if first-image (reset-snap-window img)  )             
                              (Thread/sleep (max 0 dt))  
                              (if (.windowClosed @snap-window) 
                                (edt (.enableLiveMode gui false))  
                                (show-image @snap-window img first-image)  )

                (:properties channel)))
            default-cam)]
    (set-property chan-cam)
    (let [n (long (core getNumberOfComponents))]
      (set-property default-cam)
      (get {1 1 , 4 3} n))))

(defn make-summary-metadata [settings]
  (let [depth (core getBytesPerPixel)
        channels (settings :channels)
        num-camera-channels (long (core getNumberOfCameraChannels))
        super-channels (flatten (for [channel channels] (repeat num-camera-channels channel)))]
     (JSONObject. {
      "BitDepth" (core getImageBitDepth)
