Fix assert.throws method