fixed #1649: Reverted some invokings of function that returns const reference.