Resolve threadlimit template bug