More asserts and documentation.