I think this is what you meant to do here
And here too, size-related logic problems
Merge pull request #103 from rlerdorf/patch-1

Fix a couple of minor logic problems