Fixed sinon errors in tests