Fix SQL warnings