Fixed some errors in the TypeManager