Fix "[object Object]" fragments for undefined paths

Accompanying tests to ensure this doesn’t happen in the future.