fixed up resolve/relate and added tests.