Fixed unit-tests for compatibility with npm/nodejs