Compile the inner fct in scan only once per instance.

This make the new test run in DebugMode in 1500s instead of 2ks.