Fix some flash bugs