minor sql changes