fixed bugs in rates.py