minor sql and table changes