More work on imperative code gen.