Deserialize correctly optional parameters in complex types

Change-Id: Ib8d8b5eb70d9cf420704b0f52cc8db1bea0df50d