Fixing new compiler warnings from the stricter deafault compile
settings.
Corrected average velocity calculation when the average buffer is not
full. Added average velocity tests.
Whitespace change.