rid, jid and sid weren't being set. fixes #285