(Bluefox) Fix some null pointer errors.

getUrl, match, readdir