Fix resource location failure when path has spaces