Add initial tests for the Resolver, fix some bugs.