Added types extension methods.

Other code updates.