Fixed potential endless loop while searching for resources (github issue #10).