call by reference fixes

call by reference fixes