Fix non-working custom output format.
The variable "speed" is not defined in this scope.
Additionally output timestamp and flags.