Some modifications.

+ Add remember window position.
- Remove unnecessary code.
* Use sleep instead of ping in restart action.