Redmine 2.2 support

I fixed a few strange behaviours seen with Redmine 2.2. Works nicely now.