Refactoring of Tny_add. Tny also fails gracefully if malloc fails.