fix error processing for windows, add docs