Add test for tree `valid: false` propagation
Fix issue with result object being reused