Nested discovery fixes

Sorry for the lack of tests.  Hopefully I'll get to this tomorrow.
should this just be `null`?