fix: Redmine 2.2 and Ruby 1.8.7 compatibility

Modified to work with Redmine 2.2, Ruby 1.9 / 1.8.7.