fixed some small bugs.