Some housekeeping in the CodeGen
Minor fixes in completion tests