Fixed the bugs. The bugs are mostly object initializing and typo problems.