I think it's to keep the hardness or the softness of the last letter of the stem. Длинный comes from длина where n is hard and синий comes from синь where n is soft.