Fix boundary condition on an assert.

Fixes #1324