Fixed invite test failure and added a test for #155.