More cleanup

Mostly focused around the test case class. Includes an added test case for a previously uncovered Exception path, and improves the test for IV generation.