Added retyping, and 'setparent' and 'mt' functions.