Incorporated updates from Joomla 3 defrules branch.