back to pass by value because by ref makes compiler's overloaded func matching fail
Merge pull request #920 from rwcarlsen/fix-rescast

back to pass by value - by ref makes compiler's overloaded func matching fail