Fixed bug when specifying a window and geometry at the same time