Fix provider.getValue and improve hasChildren