Array not in square shape
Using Curve modifier inevitably leads to some deformation.
In this case, try the following.


Change curve spline type to Bezier
Move the handles a bit closer (that will correct the geometry)
Increase the curve resolution to 128 (that will improve corners)


Change Spline Type to Bezier and move the handles a bit.



Increase Curve resolution to 128 to improve corners