Anomalous properties of scattering from cavities partially loaded with double-negative or single-negative metamaterials