die()s in the code with Exception, making it possible to test properly. Fixed some outdated unit tests.