Fixed some stuff noticed by Michael. Thanks :)
(See https://github.com/mbabker/joomla-cms/compare/dbsyntax)