Fixes for Joomla! 3.4.0

Thanks @dgt41 (his code!)