Ported 'OptionalParameterRefOutIssue'.
Merge pull request #430 from TheCommieDuck/ref-out

Ported 'OptionalParameterRefOutIssue'.