Hi and welcome!!
Where was loose connection?
One of butt crimps?
Or where terminals go into connector?
Here's some info that may help with wiring. Intro to moto wiring:
MO Wrenching: How To Properly Splice Wires
Here's good guide to joining wires to good-as-OEM condition:
Link to original page on YouTube.
Note that crimped-only connections are very poor joints. All wiring in pro-motorsports (F1/MotoGP), aerospace and military applications are tied/crimped, soldered and heat-shrink wrapped for performance, durability and reliability.