Add a couple asserts to try to catch infinite loop reported by Clement.