Removing `#compact` from here changes the behaviour.  A `nil` in `core_query` will result in `[nil]` instead of `[]`.