Fix "Only variable references should be returned by reference" warning