better support for functions with passed-by-reference arguments