Improve setting of window captions