updating tests, fixing bugs.