Fixed mocking functions with arguments passed by reference