A study of plasma stability in sheared magnetic fields