Fix for async bug, nodeunit test