Added compatibility with Joomla 2.5 and fixed some bugs.