Fix bug with apply tern completion.