Fix for drawing with trace enabled