Fixed rendering context bug