Added auto type registration and an example.