PASSING: fixed some bugs.