Fix some issues in Joomla 3.x