More asserts to replace with exceptions.