Fix typo causing ratechange to not be observed. Simplify foreach.

Was just perusing the code and saw a couple of simple fixes to make :)