Add path/name validation and make it easier to get real path.