Riverbasim: fixed several bugs in agents and contexts