Fix string out of bounds exception on non-windows.