Fix to problems on reading tables after refactor