Do not increment serial on every run

Code has been ported from upstream, where this issue was fixed some time ago.