Sanitize inputs for relpath compuation