In an unfortunate incident, the plastic plug for one of my A/C-powered smoke detectors became detached from the wires coming out of the ceiling. My ceiling now looks like so (click for full size):
The detached connector:
My question is: how can I safely reconnect the plug? Can I just stuff the wires back into their respective holes in the plastic connector? And, if I turn off main power to my house in my the circuit breaker box, that should be sufficient to ensure that I do not electrocute myself, correct?