WIP: Proper query inheritance.