Fixing bugs on unit tests and fix bugs on the table class