Fixed bug in state/function (apply ...).