Code generator improvements