Fix issue for passed arguments by references to method/function