diff --git a/metobs/data/__init__.py b/metobs/data/__init__.py
index 6b93d1e0cc88825bfdb06291ba1c591818e60752..bf8a2f47d3d59fd2e95130d1a4eb6df452367f3c 100644
--- a/metobs/data/__init__.py
+++ b/metobs/data/__init__.py
@@ -195,7 +195,7 @@ def potentialtemp(airTempK, pressureMB):
     if airTempK == None or  pressureMB == None:
         return NaN
 
-    pT = airTempK * (pressure.max()/pressure)**.286
+    pT = airTempK * (pressureMB.max()/pressureMB)**.286
 
     return pT
 
@@ -313,7 +313,7 @@ def array_convert(arr, sunits, cunits):
     :type cunits: string
     """
     if sunits == cunits: return arr
-    if not isinstance(arr, ndarray):: raise ValueError("Array must be of type numpy.ndarray, not %r" % (type(arr),))
+    if not isinstance(arr, ndarray): raise ValueError("Array must be of type numpy.ndarray, not %r" % (type(arr),))
     shape = arr.shape
     a = arr.flatten()
     if sunits == 'c':