Bug fixes

This doesn't look very safe: `self.accesstoken.keys()[0]`, `accesstoken` being a `dict`.