Add some assertions for debug.