diff --git a/zesje/pregrader.py b/zesje/pregrader.py
index 2df7de65f76a799a5dc049d49ede42c42ec7ccfe..18c7a502a365460473bc5af9c8efc62c998b557e 100644
--- a/zesje/pregrader.py
+++ b/zesje/pregrader.py
@@ -13,7 +13,7 @@
 import cv2
 import numpy as np
 
-from zesje.database import db, Solution, Problem, ProblemWidget
+from zesje.database import db, Solution, ProblemWidget
 from zesje.images import guess_dpi, get_box, fix_corner_markers
 
 
@@ -26,7 +26,7 @@ def add_feedback_to_solution(page, page_img, corner_keypoints):
     page_img: image of the page
     barcode: data from the barcode on the page
     """
-    widgets = ProblemWidget.filter(ProblemWidget.page == page).all()
+    widgets = ProblemWidget.query.filter(ProblemWidget.page == page).all()
 
     problems_on_page = [widget.problem for widget in widgets]
 
@@ -41,7 +41,7 @@ def add_feedback_to_solution(page, page_img, corner_keypoints):
 
                 # check if box is filled
                 if box_is_filled(box, page_img, corner_keypoints):
-                    sol.feedback.append(mc_option.feedback)
+                    sol.feedback.text = mc_option.label
                     db.session.commit()
 
 
@@ -82,10 +82,10 @@ def box_is_filled(box, page_img, corner_keypoints, marker_margin=72/2.54, thresh
 
     # add the actually margin from the scan to corner markers to the coords in inches
     dpi = guess_dpi(page_img)
-    coords[0] = coords[0] + corner_keypoints[1]/dpi
-    coords[1] = coords[1] + corner_keypoints[1]/dpi
-    coords[2] = coords[2] + corner_keypoints[0]/dpi
-    coords[3] = coords[3] + corner_keypoints[0]/dpi
+    coords[0] = coords[0] + corner_keypoints[1][1]/dpi
+    coords[1] = coords[1] + corner_keypoints[1][1]/dpi
+    coords[2] = coords[2] + corner_keypoints[0][0]/dpi
+    coords[3] = coords[3] + corner_keypoints[0][0]/dpi
 
     # get the box where we think the box is
     cut_im = get_box(page_img, coords, padding=cut_padding)
diff --git a/zesje/scans.py b/zesje/scans.py
index f32c0ff1debff0434fcf06fc4244ee4b262527be..33cd53bd2efaf31624986cecb6221f35b28f9095 100644
--- a/zesje/scans.py
+++ b/zesje/scans.py
@@ -5,6 +5,7 @@ import os
 from collections import namedtuple, Counter
 from io import BytesIO
 import signal
+import traceback
 
 import cv2
 import numpy as np
@@ -53,7 +54,7 @@ def process_pdf(scan_id):
         # TODO: When #182 is implemented, properly separate user-facing
         #       messages (written to DB) from developer-facing messages,
         #       which should be written into the log.
-        write_pdf_status(scan_id, 'error', "Unexpected error: " + str(error))
+        write_pdf_status(scan_id, 'error', "Unexpected error: " + traceback.format_exc())
 
 
 def _process_pdf(scan_id, app_config):
@@ -77,22 +78,22 @@ def _process_pdf(scan_id, app_config):
 
     total = PyPDF2.PdfFileReader(open(pdf_path, "rb")).getNumPages()
     failures = []
-    # try:
-    for image, page in extract_images(pdf_path):
-        report_progress(f'Processing page {page} / {total}')
-        # try:
-        success, description = process_page(
-            image, exam_config, output_directory
-        )
-        if not success:
-            print(description)
-            failures.append(page)
-    # except Exception as e:
-        #     report_error(f'Error processing page {e.__cause__}')
-            return
-    # except Exception as e:
-    #     report_error(f"Failed to read pdf: {e}")
-    #     raise
+    try:
+        for image, page in extract_images(pdf_path):
+            report_progress(f'Processing page {page} / {total}')
+            try:
+                success, description = process_page(
+                    image, exam_config, output_directory
+                )
+                if not success:
+                    print(description)
+                    failures.append(page)
+            except Exception:
+                report_error(f'Error processing page {traceback.format_exc()}')
+                raise
+    except Exception as e:
+        report_error(f"Failed to read pdf: {e}")
+        raise
 
     if failures:
         processed = total - len(failures)