fixed off-by-one error caused by the asserts we put in for unit testing.  Irony!