fixed up some table errors
added sql updates