Fix some bugs.

Fix detection error on user is post rate-limited.
Fix resolving entities error.
Improve performance.