Clarify docs on the return. Fix a memory leak if a type with a value table