Fix NSI connection-service id
Fix NPE and substitution issue.