Added functionality to specify a maximum tag limit.