Fix by ref warning