Various changes to make it work with Redmine 2.2+.