Minor SQL changes