fixed a crash in set_classname() and set_pkgname()