Fix target-dir update checks, fixes #2395