More debug, fixes in tables and indexes definition