Using a rigorous differential theory of diffraction gratings, we have investigated the optical properties of some peculiar bandgap structures. We have dealt with devices made of two stacks of equidistant rod gratings separated by a central planar defect which leads to the occurrence of a transmission peak inside the wavelength bandgap. We have studied how the stability of the effective bandgaps copes with fluctuations of various experimental parameters. For various bandgaps and polarizations in structures including a defect (DS) we have studied the resulting filter characteristics and its possibilities as optical switch when the defect is made of nonlinear material. As long as plastics have convenient refractive indices, optical losses and nonlinearities, the devices we describe could be manufactured using such materials.