Invalid arguments in DynamicContext constructor