avoid negative values for speed and distance
minor cleanup for bike flagencoder