Added OS check to remove ANSI escape sequences on Windows. Not sure if needed...