Fix bug in NS code.