Fix byref transformation not being applied to constructor arguments.
Fix otherwise unused variables being able to be eliminated despite being passed by ref.
Add test for issue #173 (fixed).