     shouldReviveProvider
     shouldReviveProvisioners
     shouldLockProcess
+    hasOptions
   }, fn) ->
 
   (client, options, _callback) ->
 
+    hasOptions ?= yes
+
+    unless hasOptions
+      [options, _callback] = [_callback, options]
+      options = {}
+
     unless typeof _callback is 'function'
-      _callback = (err)-> console.error "Unhandled error:", err.message
+      _callback = (err)->
+        console.error "Unhandled error:", err?.message or err
 
     if shouldLockProcess
 

        reviveProvisioners client, provisioners, (err, provisioners)=>

          options.provisioners = provisioners  if provisioners?
          fn.call this, client, options, callback

        , shouldReviveProvisioners



      callback = _callback

    shouldReviveProvider ?= yes

    {provider, credential, provisioners} = options

    if shouldReviveProvider
