Fixed bug when $this->tables is empty