Fixing compilation with --disable-graphics option