Fixed some bugs
Revert "Fixed some bugs"

This reverts commit 08f78147f844982429f439b4772f63f5dfd24328.