Fix to R location regression on windows and linux