To prevent this, I built the simple jig shown in the photo below. It provides an accurate reference that makes it easy to square up the door. A glance at the drawing shows that the jig consists of a plywood base that supports the door and two wood cleats that form a square corner. It’s important that the cleats are 90° to each other. So start by attaching one cleat with glue and screws. Then use a framing square to position the second cleat as you glue and screw it in place.
To use the jig, start by placing each clamp directly over (and parallel to) the rails of the frame. Then, adjust the pressure and position of the clamps until the frame sits square in the jig. Note: To prevent glue from sticking to the jig, I brushed on several coats of a polyurethane finish.