Fixed the bug that made flashing painfully slow.