Nested types & some fixes