The headlight problem is quite simple. On the right headlight you will only have 2 wires coming from the connection at the back of the bulb whereas the left side has 3. If you lift you petrol tank and look in the black wiring box, you will find a union with a green wire going into it but nothing coming out of it on the opposite side. Simply connect a new wire from the blank part of the right side headlight(top hole of the headlight plug) and run it to the green wire in the wire box under the tank. if none are working at the moment I would think you may have either connected to the wrong wire and it's shorting or you may have blown the fuse or bulb???
As for the petrol cap, you could try spraying a bit of wd40 on the spring and latch whilst the cap is vertical and try squeezing it with some pliers to work it free, or take the cap completely off and soak it in some oil overnight or completely soak it in wd40 and let it sit a while.. Wouldn't suggest taking the cap apart as if not put back correctly you could end up with fuel slopping out of the top when riding or air getting in with loss of power. Failing that just buy another cap with key? Hope that is some kind of help..