On grating-coupled radiation from waveguides