Extended type support

My C is not really good, so please review this properly. Thank you.