Corrected indices on lenght of tables.
Corrected again...