Use correct err method.
Update spec test to remove mocha warnings.