Fix for path resolving, added tests.