Fixed code generation on graphical mode