All nomination petitions and nomination papers received and filed under this chapter, and accepted after the examination required by section 411 of this title, shall be deemed to be valid, unless, within five days after the last day for filing such nomination petition or papers, a petition is presented to the district court, specifically setting forth the objections thereto, and praying that such petition or paper be set aside. A copy of the petition shall, within such period, be served on the officer with whom the nomination petition or paper was filed. Upon the presentation of such a petition the court shall make an order fixing a time for hearing which shall not be later than 10 days after the last day for filing such nomination petition or paper, and specifying the time and manner of notice that shall be given to the candidate named in the nomination petition or paper sought to be set aside. On the day fixed for the hearing, the court shall proceed without delay to hear such objections, and shall give the hearing precedence over any other business before it, and shall finally determine the matter not later than 15 days after the last day for filing such nomination petitions or papers. If the court finds that the nomination petition or paper is defective under the provisions of section 411 of this title, or that it does not contain a sufficient number of genuine signatures of electors entitled to sign it under the provisions of this chapter, or was not filed by persons entitled to file it, it shall be set aside. If the objections relate to material errors or defects apparent on the face of the nomination petition or paper, or on the face of the accompanying or appended affidavits, the court, after hearing, may, in its discretion, permit amendments within such time and upon such terms as to payment of costs, as the court may specify. In case a petition under this section is dismissed, the court shall make such order as to the payment of the cost of the proceeding, including witness fees, as it shall deem just. If a person shall sign any nomination petitions or papers for a greater number of candidates than he is permitted under the provisions of this chapter, if such signatures bear the same date, they shall, upon objections filed thereto, not be counted on any petition or paper and if they bear different dates, they shall be counted in the order of their priority of date, for only so many persons as there are candidates to be nominated or voted for by an elector at the general election.