This is the result of not cooking the sweet potatoes long enough or not mashing them thoroughly. Make sure to cook the sweet potatoes until they are very soft, and use a potato masher or an electric mixer to achieve a smooth consistency.