Revert "Fix some bugs"

This reverts commit 95c7a62f69c67b74097f509d300dbe990460b8a7.