Fixed calculations for annualized rate of return.
The query is pretty disgusting...