Even more more SQL fixes.