The effect of In surfactant during metalorganic vapor phase epitaxial growth on sapphire substrates on the properties of GaN layers is studied using time-resolved photoluminescence, cathodoluminescence, and scanning electron microscopy. The samples are divided into two groups, where hydrogen and nitrogen, respectively, have been used as a carrier gas during growth. It is shown that In-doped samples have a lower dislocation density, a narrower photoluminescence linewidth, and a longer free exciton lifetime. The influence of indium is stronger for GaN layers grown in nitrogen-rich conditions. The improvements of structural and optical properties are attributed to the effect of In on dislocations.