(a) No petition for relief shall be dismissed for failure to follow the prescribed form or procedure until the court has given the petitioner reasonable opportunity, with the aid of counsel, to file an amended petition.
(b) Nothing in this section shall be construed to prohibit the court from dismissing a petition under this part when it does not state a proper claim for relief.