Fix failing tests (after when.js upgrade)