Hi Samuel,
I think that what you did is the correct approach. Basically, if you want to return a real object, you need to create it, and you can pass it the fake configuration object (which, as I understand it, is what you did).
Thanks for reporting (and that you found a workaround)