Fixed no-results bug, improve error-handling.