Fix incorrect pass by reference