Fixed some standards violations and fixed issue with $this->table usage