cleaned debug lines
fixed some more sql issues