Certain cases caused last task not to be listed

When the maxListItems was greater than the number of items in the list
or less than 0, then it was re-set to the length of the list minus
one. This caused the last task to not be listed.

Close #22