o SQL fixes and check for more errors