Interactions and stability of solitary waves in shallow water