A systematic investigation of the effect of rapid thermal annealing (RTA) on optical properties of undoped GaNAs/GaAs structures is reported. Two effects are suggested to account for the observed dramatic improvement in the quality of the GaNxAs1-x/GaAs quantum structures after RTA: (i) improved composition uniformity of the GaNxAs1-x alloy, deduced from the photoluminescence (PL), PL excitation and time-resolved measurements; and (ii) significant reduction in the concentration of competing nonradiative defects, revealed by the optically detected magnetic resonance studies.