Fix the "too many sql variables" bug.