Fixed the problem with handling unknown name_type ("-")

Also added message logging code. Log messages are to be added yet.