Fix the database checks
Merge branch 'patch-1' of https://github.com/wilsonge/joomla-cms into patch-1