Merged changed from v.1.3.5 for Joomla! 2.5+