Fixed bugs when using --use-instrumentation