I've noticed `fit-frame-to-buffer` results in incorrect frame position when the frame is not a child frame. I've looked into the code and seems that there are two issues: first is that frame monitor is ignored, always first monitor in `display-monitor-attributes-list` is used. Second is that `workarea` and `geometry` are in the form of `(X Y WIDTH HEIGHT)` but code treats them as `(X1 Y1 X2 Y2)`. I'm providing a patch that fixes both issues.