Added a bunch of stuff to make the register form work.