Added error statuses and restored settings.
Fixed strange bug with mocha tests