Fixed "sticky pixel" bug by changing tailLength var to double from uint8_t.