Small enhancements.

Added missing ```$this->prefix_db``` and aliases to the SQL queries.