Fixed some typos, errors in namefile handling