Stability of the magnetopause