Fix nested types problem