Fix ability to invite users. Remove unused variables.