Fix bugs in largeset case