Fixed unitialized field of text windows

The bug caused the text windows to (sometimes) not work.