Fix graphics code