fix handling of consecutive optional arguments
am: fea05c6dca

Change-Id: I9ef1f9f3590d2f23a2f0468a8c982b34a56c9679