So many SQL bug fixes