Change default value of ret to -1.