Fixed wrong condition and exception message when using getResults() & getResultCount()