Generate category limits correctly -- thanks to NE!