Replaced direct access to the WND structure by corresponding calls to