Fixed bugs filling the tables