Fixed a huge bug in rate estimation.