Assertion improvements and minor style fix