Added realpath() call to handle symlink resources.