Try unplugging the tailgate handle, there is a microswitch in there that unlatches the glass, it is known to fail and make the glass pop open randomly. If that doesn't work then you probably need to get another latch from a scrapper.
Check the ABS sensor wiring, I'm guessing it's later than 04...