This is a bug.  Should test for <, not <=.