Made sinon spies loop in tests, corrected sp error