Change how inplace detection works, so that it also works on Windows