Fix drawing invalid boxes sometimes.