Fix RegisterFrom template bug