Helping to make more compatible to Joomla 3

Was made some small changes to make it more compatible to Joomla 3