fixing some sql client bugs