Improved scattering matrix method for the analysis of two-dimensional PBG devices