diff --git a/raytracing/matrix.py b/raytracing/matrix.py
index 2f8ff11..7f32c1b 100644
--- a/raytracing/matrix.py
+++ b/raytracing/matrix.py
@@ -122,6 +122,8 @@ class Matrix(object):
         # Length of this element
         self.L = float(physicalLength)
         # Aperture
+        if apertureDiameter <= 0:
+            raise ValueError("The aperture diameter must be strictly positive.")
         self.apertureDiameter = apertureDiameter
 
         # First and last interfaces. Used for BFL and FFL
@@ -163,7 +165,7 @@ class Matrix(object):
 
         if self.C == 0:
             return self.A * self.D
-        
+
         return self.A * self.D - self.B * self.C
 
     def __mul__(self, rightSide):

diff --git a/raytracing/tests/testsMatrix.py b/raytracing/tests/testsMatrix.py
index f36fe01..c160580 100644
--- a/raytracing/tests/testsMatrix.py
+++ b/raytracing/tests/testsMatrix.py
@@ -20,9 +20,17 @@ class TestMatrix(envtest.RaytracingTestCase):
         m = Matrix()
         self.assertIsNotNone(m)
 
+    def testNullApertureDiameter(self):
+        with self.assertRaises(ValueError):
+            Matrix(apertureDiameter=0)
+
+    def testNegativeApertureDiameter(self):
+        with self.assertRaises(ValueError):
+            Matrix(apertureDiameter=-0.1)
+
     def testMatrixExplicit(self):
         m = Matrix(A=1, B=0, C=0, D=1, physicalLength=1,
-                   frontVertex=0, backVertex=0, apertureDiameter=1.0)
+                   frontVertex=0, backVertex=0, apertureDiameter=0.5)
         self.assertIsNotNone(m)
         self.assertEqual(m.A, 1)
         self.assertEqual(m.B, 0)
@@ -31,7 +39,7 @@ class TestMatrix(envtest.RaytracingTestCase):
         self.assertEqual(m.L, 1)
         self.assertEqual(m.backVertex, 0)
         self.assertEqual(m.frontVertex, 0)
-        self.assertEqual(m.apertureDiameter, 1)
+        self.assertEqual(m.apertureDiameter, 0.5)
 
     def testMatrixProductMath(self):
         m1 = Matrix(A=4, B=3, C=1, D=1)
@@ -586,16 +594,16 @@ class TestMatrix(envtest.RaytracingTestCase):
         self.assertNotEqual(m, "Trust me, this is a Matrix. This is equal to Matrix()")
 
     def testEqualityMatricesNotEqualSameABCD(self):
-        m = Matrix(1,0,0,1)
-        m2 = Matrix(1,0,0,1, frontVertex=1)
+        m = Matrix(1, 0, 0, 1)
+        m2 = Matrix(1, 0, 0, 1, frontVertex=1)
         self.assertNotEqual(m, m2)
-        m2 = Matrix(1,0,0,1, backVertex=1)
+        m2 = Matrix(1, 0, 0, 1, backVertex=1)
         self.assertNotEqual(m, m2)
-        m2 = Matrix(1,0,0,1, frontIndex=10, backIndex=10)
+        m2 = Matrix(1, 0, 0, 1, frontIndex=10, backIndex=10)
         self.assertNotEqual(m, m2)
 
     def testEqualityMatricesNotEqualDifferentABCD(self):
-        m = Matrix(1,0,0,1)
+        m = Matrix(1, 0, 0, 1)
         m2 = Matrix(A=1 / 2, D=2)
         self.assertNotEqual(m, m2)
 

Matrix accepts a negative aperture diameter
This doesn't make any sense. Even the doc specifies that it must be positive.
raytracing/tests/testsMatrix.py::TestMatrix::testNegativeApertureDiameter raytracing/tests/testsMatrix.py::TestMatrix::testNullApertureDiameter
raytracing/tests/testsMatrix.py::TestMatrix::testApertureDiameter raytracing/tests/testsMatrix.py::TestMatrix::testBackFocalLengthSupposedNone raytracing/tests/testsMatrix.py::TestMatrix::testDielectricInterfaceEffectiveFocalLengths raytracing/tests/testsMatrix.py::TestMatrix::testDisplayHalfHeight raytracing/tests/testsMatrix.py::TestMatrix::testDisplayHalfHeightInfiniteDiameter raytracing/tests/testsMatrix.py::TestMatrix::testEffectiveFocalLengthsHasPower raytracing/tests/testsMatrix.py::TestMatrix::testEffectiveFocalLengthsNoPower raytracing/tests/testsMatrix.py::TestMatrix::testEqualityMatricesAreEqual raytracing/tests/testsMatrix.py::TestMatrix::testEqualityMatricesNotEqualDifferentABCD raytracing/tests/testsMatrix.py::TestMatrix::testEqualityMatricesNotEqualSameABCD raytracing/tests/testsMatrix.py::TestMatrix::testEqualityMatrixAndSpaceEqual raytracing/tests/testsMatrix.py::TestMatrix::testEqualityNotSameClassInstance raytracing/tests/testsMatrix.py::TestMatrix::testFiniteBackConjugate_1 raytracing/tests/testsMatrix.py::TestMatrix::testFiniteBackConjugate_2 raytracing/tests/testsMatrix.py::TestMatrix::testFiniteForwardConjugate raytracing/tests/testsMatrix.py::TestMatrix::testFiniteForwardConjugates_2 raytracing/tests/testsMatrix.py::TestMatrix::testFocusPositions raytracing/tests/testsMatrix.py::TestMatrix::testFocusPositionsNoPower raytracing/tests/testsMatrix.py::TestMatrix::testFrontFocalLengthSupposedNone raytracing/tests/testsMatrix.py::TestMatrix::testHasNoPower raytracing/tests/testsMatrix.py::TestMatrix::testInfiniteBackConjugate raytracing/tests/testsMatrix.py::TestMatrix::testInfiniteForwardConjugate raytracing/tests/testsMatrix.py::TestMatrix::testIsIdentity raytracing/tests/testsMatrix.py::TestMatrix::testIsImaging raytracing/tests/testsMatrix.py::TestMatrix::testIsNotIdentity raytracing/tests/testsMatrix.py::TestMatrix::testIsNotImaging raytracing/tests/testsMatrix.py::TestMatrix::testLagrangeInvariantSpace raytracing/tests/testsMatrix.py::TestMatrix::testMagnificationImaging raytracing/tests/testsMatrix.py::TestMatrix::testMagnificationNotImaging raytracing/tests/testsMatrix.py::TestMatrix::testMatrix raytracing/tests/testsMatrix.py::TestMatrix::testMatrixBackFocalLength raytracing/tests/testsMatrix.py::TestMatrix::testMatrixExplicit raytracing/tests/testsMatrix.py::TestMatrix::testMatrixFlipOrientation raytracing/tests/testsMatrix.py::TestMatrix::testMatrixFrontFocalLength raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductGaussianBeamMath raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductGaussianBeamWavelengthOut raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductGaussianClippedOverAperture raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductGaussianInitiallyClipped raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductGaussianLength raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductGaussianNotClipped raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductGaussianNotSameRefractionIndex raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductGaussianRefractIndexOut raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductIndicesBoth1 raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductIndicesLHSIsIdentity raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductIndicesNoIdentity raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductIndicesRHSIsIdentity raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductLength raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductMath raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductOutputRayAperture raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductOutputRayLength raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductRayAlreadyBlocked raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductRayGoesInAperture raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductUnknownRightSide raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductVertices raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductVerticesAllNone raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductVerticesFirstNone raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductVerticesSecondNone raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductVerticesTwoElements raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductVerticesTwoElementsRepresentingGroups raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductWithRayGoesOverAperture raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductWithRayGoesUnderAperture raytracing/tests/testsMatrix.py::TestMatrix::testMatrixProductWithRayMath raytracing/tests/testsMatrix.py::TestMatrix::testPointsOfInterest raytracing/tests/testsMatrix.py::TestMatrix::testPrincipalPlanePositions raytracing/tests/testsMatrix.py::TestMatrix::testPrincipalPlanePositionsNoPower raytracing/tests/testsMatrix.py::TestMatrix::testStrRepresentation raytracing/tests/testsMatrix.py::TestMatrix::testStrRepresentationAfocal raytracing/tests/testsMatrix.py::TestMatrix::testTrace raytracing/tests/testsMatrix.py::TestMatrix::testTraceBlocked raytracing/tests/testsMatrix.py::TestMatrix::testTraceGaussianBeam raytracing/tests/testsMatrix.py::TestMatrix::testTraceMany raytracing/tests/testsMatrix.py::TestMatrix::testTraceManyJustOne raytracing/tests/testsMatrix.py::TestMatrix::testTraceManyThroughInParallel raytracing/tests/testsMatrix.py::TestMatrix::testTraceManyThroughIterable raytracing/tests/testsMatrix.py::TestMatrix::testTraceManyThroughLastRayBlocked raytracing/tests/testsMatrix.py::TestMatrix::testTraceManyThroughNoOutput raytracing/tests/testsMatrix.py::TestMatrix::testTraceManyThroughNotIterable raytracing/tests/testsMatrix.py::TestMatrix::testTraceManyThroughOutput raytracing/tests/testsMatrix.py::TestMatrix::testTraceNullLength raytracing/tests/testsMatrix.py::TestMatrix::testTraceThrough raytracing/tests/testsMatrix.py::TestMatrix::testTransferMatrices raytracing/tests/testsMatrix.py::TestMatrix::testTransferMatrix raytracing/tests/testsMatrix.py::TestMatrix::testWarningsFormat