Fixed bug in limit handling