Fix some incompetant SQLing on my part