Fix the bug with outer types in impl of #735