Rename Mailbox class, fix some bugs