Stability of Triple Solitary Waves and Effects of Inhomogeneities