Fixed Bedroom Electricity

So, as I was going to bed last night, I plugged my laptop in the outlet by my mattress and poof, lights in the room went out. I thought I had blown the circuit, but then turned and found that the stuff plugged in on the other side of the room was still on. I went to the basement and found that the circuit was not blown. I figured that whatever was loose in the box that I put the cover on the other day, must have finally separated. Since it was around 11pm when I discovered this, I decided not to try to fix it immediately. (I don't ever work on stuff when I'm tired because that seems to be when I make truly dumb mistakes.) I shut the breaker off to the room, just to be on the safe side and went to bed. I got up around 6am and decided to check the wires in the one box. After retwisting them together, I put the cap on and some electrical tape for good measure. When I turned the breaker back on, everything worked fine. So, small problem fixed.