Fix a warning and improve handling of graphics