Updated the resource path detection code.