Fix tests

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