adjustments for Windows and error handling