In any personal action on contract instituted in a court of record, wherein it is ascertained that not more is due the plaintiff than $50, exclusive of interest, judgment shall be given for the defendant, unless the court enter of record that the matter in controversy was of greater value than fifty dollars, exclusive of interest; in which case it may give judgment for the plaintiff for what is ascertained to be due him with or without costs, as to it may seem right.