Fix SQL syntax.
Merge branch 'master' into horde_5_2