Registration authentication added, tests improved.