Fixed mailbox and mailbox group parsing. Added unit tests.