Minor cleanups.
Added assertions.