Fixed #3806: Change parameters to const &