Glad you got the bike running right again. Not trying to tell you what to use, but WD40 is about the worse thing you can spray on electrical connections. Yes I know it seems to have worked, but next time use something like HD part# 99861-02 or Deoxit 5 spray.
When it comes to WD40, you want to own the Stock, not the Product.