Transmission electron microscopy studies were applied to study GaN crystals doped with Mg. Both: bulk GaN:Mg crystals grown by a high pressure and high temperature process and those grown by metal-organic chemical-vapor deposition (MOCVD) have been studied. Structural dependence on growth polarity was observed in the bulk crystals. Spontaneous ordering (formation of polytypoids) was observed for growth in the N to Ga polar direction (N polarity). On the opposite site of the crystal (growth in the Ga to N polar direction) Mg-rich pyramidal defects with base on the basal planes and with walls inclined about 45O to these planes, empty inside (pinholes) were observed. A high concentration of these pyramidal defects was also observed in the MOCVD grown crystals. For samples grown with Mg delta doping planar defects were also observed especially at the early stages of growth followed by formation of pyramidal defects. TEM and x-ray studies of InxGa1-xN crystals for the range of 28-45 percent nominal In concentration shows formation of two sub-layers: strained and relaxed, with a much lower In concentration in the strained layer. Layers with the highest In concentration were fully relaxed.