Fix extractProperty, add some tests for resolveLeaf