Fixed error handling and callbacks for exec and execFile