Improve resource path handling