Proper window initialization