Fix for argument substitution handling

Change-Id: Iec099b6edf8762535d2df1fc5f36889f184e2636
Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>