Fix library flavor detection for the validate script as well