                              num-plots
                              plot-spacing
                              plot-size]
-  (let [[[left bottom] [top right]] (pu/EPSG:4326->3857 [lon-min lat-min] [lon-max lat-max])
-        [left bottom right top]     (pad-bounds left bottom top right (/ 2.0 plot-size))]
+  (let [[[left bottom] [right top]] (pu/EPSG:4326->3857 [lon-min lat-min] [lon-max lat-max])
+        [left bottom right top]     (pad-bounds left bottom right top (/ 2.0 plot-size))]
     (check-plot-limits (if (= "gridded" plot-distribution)
                          (count-gridded-points left bottom right top plot-spacing)
                          num-plots)

                                                 folder-name
                                                 (str "project-" project-id "-" design-type))]
      (try-catch-throw #(let [[headers body] (get-file-data distribution design-type saved-file folder-name)]
                          (when-not (seq? body)
                            (init-throw (str "The " design-type " file contains no rows of data.")))

                          (check-headers headers primary-key design-type)


      (#{"csv" "shp"} sample-distribution)
      (do
        ;; FIXME Add process to restore external samples when allow-drawn-samples? is true.
        (init-throw "Restoring external samples for user drawn samples is temporarily broken.")
        #_(call-sql "delete_all_samples_by_project" project-id)
        #_(call-sql "copy_saved_samples" project-id))

      :else
