fixed errors in tests.js