A fix for unexpected behaviour with symlinks