Compatibility with 2.4.

I had several problems with this plugin and Cake 2.4. I made some changes and everything is working right in the last version (2.4.4).