Tighten up codegen interface

Fix double import bug