Fixing compile problems with graphics on