corrected implementation of isLocalResource, added testcases...