How could Sarah's treatment of Hagar and Ishmael be considered righteous? I intend this as a sincere and serious question. While Hagar was pregnant, Sarah "prevent[ed] her intercourse with Abraham, whipped her with her slipper, and exacted humiliating services, such as carrying her bathing-materials to the bath (l.c.);she further caused Hagar by an evil eye to miscarry." (Source) Then, when Ishmael teased Isaac, Sarah insisted that Abraham send both Ishmael and Hagar away from her family, thus estranging a young son from his father, ensuring that son would receive none of his father's inheritance, and nearly causing both mother and son to die of thirst in the desert.
Obviously, G-d intervened and prevailed, and everything was okay in the end. (Except for the inheritance part, of course.) Still, how can any of this be considered righteous behavior on Sarah's part?