Fix several bugs in Devise, update mailer templates