This chapter shall be liberally construed, and the plaintiff, at any time when objection is made thereto, shall be permitted to amend any defect in the petition, affidavit, bond, writ, or other proceeding; and no attachment shall be quashed or dismissed, or the property attached released, if the defect in any of the proceedings has or can be amended so as to show that a legal cause for the attachment existed at the time it was issued; and the court shall give the plaintiff a reasonable time to perfect such defective proceedings.