Fix bug in plugins not waiting for context