Fixed arithmetic problem with recursion.