Fixed code gen