Changed bootstrap API to be similar with R boot package