Fix serialization of window ID