Change of window and replace several bugs.