Sorry for the delay, I've been slammed with work and not playing Factorio lately. Gonna see if I can get this working this weekend.
As for the number sticking around, I think that should get cleaned up the next time the game regizmitizes the tubes, which either happens when you load the game, or when any mod changes (version change or added/removed).