Fixed fstat()
Implemented window moving, resizing and closing