Fixed fatal errors related to calling protected query() method