Fixed a bug where the exception thrown was not caught when no tags are left in the custom tag range.