Fixed issue with limits.

Hi,

I've corrected a mistake I made with the limits. Could someone throw their eye over the database branch I've created and see if it would be of any use? Thanks

   fintan