Switch exceptions to asserts