diff --git a/dependencies/parsers/crystal b/dependencies/parsers/crystal
index df1175fab88a5216da20b75f81c7374d8df938df..b31800d887ce99d21a7a4048fdfbfe9aff8df33b 160000
--- a/dependencies/parsers/crystal
+++ b/dependencies/parsers/crystal
@@ -1 +1 @@
-Subproject commit df1175fab88a5216da20b75f81c7374d8df938df
+Subproject commit b31800d887ce99d21a7a4048fdfbfe9aff8df33b
diff --git a/nomad/atomutils.py b/nomad/atomutils.py
index c64ee1ba496051628e330e7f63e47725197e69d7..4895da1713f71ca9d0e430e1c18986e6e098e2a5 100644
--- a/nomad/atomutils.py
+++ b/nomad/atomutils.py
@@ -65,7 +65,7 @@ def wrap_positions(
         cell: np.ndarray = None,
         pbc: Union[bool, np.ndarray] = True,
         center: np.ndarray = [0.5, 0.5, 0.5],
-        eps: float = 1e-7) -> np.ndarray:
+        eps: float = 1e-12) -> np.ndarray:
     """Wraps the given position so that they are within the unit cell. If no
     cell is given, scaled positions are assumed. For wrapping cartesian
     positions you also need to provide the cell.
@@ -93,13 +93,14 @@ def wrap_positions(
     if cell is None:
         fractional = positions
     else:
-        fractional = to_scaled(positions) - shift
+        fractional = to_scaled(positions, cell)
+    fractional -= shift
 
     for i, periodic in enumerate(pbc):
         if periodic:
             fractional[:, i] %= 1.0
-            fractional[:, i] += shift[i]
-    if cell:
+        fractional[:, i] += shift[i]
+    if cell is not None:
         return np.dot(fractional, cell)
     else:
         return fractional