Corrected error in make_pinning() function