Undefined index problem fixed, refs #1170.
Merge pull request #1201 from phaidon/undefined-index

Undefined index problem fixed, refs #1170.
Update email function fixed.
Merge pull request #1203 from phaidon/update-email-fix

Update email function fixed.