Change window initialization in flower and fix some random bugs.