Migerate the repository to Linux.

Fix some bugs.