Minor sql fix