Add Joomla 3.2 compatibility

Fix code for Joomla 3.2 compatibility and Joomla Coding Standards