Fixed testing so that it can be run with npm test