Fix up the actionFinally and actionOnException functions