fix bug in arguments cleanup