Fixed some minor bugs.