fix some bugs related to the window client

this still needs a lot of work, hence, consider
windows client broken ...
However this commit does fix issue #17