Bugfix: Fix some logic bug.
Refactor: Reduce unnecessary condition determination.
Bugfix: Fix save origin logic bug.