Fixed import issue in codegen, minor fixes elsewhere