nms entities phase 2 and other bug fixes