Fix table creation + add indexes