Added patch provided by conradi via the Activiti forum