Fix cleanup (lock version) in loans