Cover auto-injection by unit-tests. Fix compilation errors for OSX (wrong target ownership of new files)