Fixed some bugs around argument insertion. Added support for named arguments.