close #8; fix NPE in injected code