If the writ be made returnable to the wrong court, the case shall not be dismissed nor affected thereby, but shall be transferred to the proper court, and the cause shall be there proceeded with as if the writ had been made returnable there; and any bond given shall not be affected by such mistake, but it may be proceeded on in the proper court.