Fixed CLI marshaling of in/out parameters under some cases.

Closes pull #269.