(a) Effects; amendments.— No person arrested under a warrant or appearing before a magistrate in response to a summons shall be discharged from custody or dismissed because of any informality in the warrant or summons. The magistrate may correct such informality by amendment.
(b) Filing of a new complaint or issuance of a new warrant or summons.— If when a defendant arrested under a warrant or appearing in response to a summons is brought before the magistrate, it appears that the complaint or the warrant or the summons does not properly name or describe the defendant or the offense with which he is charged, but there are reasonable grounds to believe that the defendant has committed the offense or some other offense, the magistrate shall not discharge or dismiss the defendant, but shall forthwith cause a new complaint to be filed and shall thereupon issue a new warrant or summons as may be appropriate.