(a) If the action to foreclose the lien is not brought to trial within two years after the commencement thereof, the court may in its discretion dismiss the same for want of prosecution.
(b) In all cases the dismissal of an action to foreclose the lien (unless it is expressly stated that the same is without prejudice) or a judgment rendered therein that no lien exists shall be equivalent to the cancellation and removal from the record of such lien.
(c) In addition to any other costs allowed by law, the court in an action to foreclose a lien must also allow as costs the money paid for verifying and recording the lien, such costs to be allowed each claimant whose lien is established, whether he be plaintiff or defendant.
(d) Whenever on the sale of the property subject to any liens provided for in this chapter, under a judgment of foreclosure of such lien, there is a deficiency of proceeds, judgment for the deficiency may be entered against any party personally liable therefor in like manner and with like effect as in an action for the foreclosure of a mortgage.