fixed some minor bugs.