Fix an issue where curry goes into an infinite loop