Replaces abspath with realpath