Fix some bugs with avatar helper.