Make sure Loan is not saved if ncip checkout fails, and fix tests