Take into account current resource's path

Fixes #6