Fixed compiler errors while retaining NIInvocation code

I'm still not sure what I should do before checkin exactly (which target, which tests for example). But I manually built every scheme this time.