Auto set relative path when possible.