Fix names of defined types and make it actually work.