fix global var leakage.
documentation fixes