Fix crash due to incorrect resolution of type of NSM characters (bug#5858).