Fixed the minor bugs