Used JDatabaseQuery for in helper.php and added few empty checks in tmpl/default.php: Issue #3