Move check_libs higher