Make ancestor queries actually work