Fixed lazy sql problems.  Doh