Graphics engine bug fix