console.assert seems to cause some deoptimizations. Avoid unless needed.