Fix a bug in loan granting