Properly handle limit 0
Merge pull request #586 from tgriesser/limit-0

Properly handle limit 0