Replacing exit with assert, as exits are hard to find.