Fix tests

The project's tests had some problems. Fixed'em so that anyone can run `npm test` to check if their code is all green.