(b)on the terms on which the claimant held it if he and the person who did not claim the land belonged to different classes: Provided always that if the landlord obtaining eviction had paid any value for improvements to anyone whose interests were so terminated, the person claiming restoration shall, before such restoration is effected, be bound to return to the landlord the value so paid in respect of the improvements existing at the time of the restoration together with the kanartham, if any, and also the value of the improvements, if any, effected bona fide by the landlord between the date of eviction and the date of suit.