Memory leak prevention, more type/name cleanup