Fix codec fallback and generate type imports