Study of imperfections and structure in nonlinear-optical crystals of β-BaB2O4