Change required and strict behaviour, add tests for resolveLeaf