Update/improve the way we check for libraries