Pull changes for #946 and #1070 to improve pending invite management

@skivvies really nice work on this!  I just did a little testing and it looks good to me, so I'm pull requesting.