Add nameSetElemsStable and fix the build