Dirt Riding 101 class time..
when riding in rutty terrain, it's best to DECOUPLE YOUR WEIGHT from the bike...you can do this by STANDING on the pedals, and removing your butt from the seat... Also, make sure that your thighs are NOT touching the frame's Top bar, or seat.
this allows the bike to shift around into different ruts, but your mass doesn't cause the bike to shift more than needed.(a weight in motion wishes to remain in motion)
and quit death-gripping the handlebars.
and i hate ruts/grooves almost as much as sticks/roots crossing trails at an angle...

and then... there's those wet railroad/trolley tracks.... bunny-hop them suckers, or carry lots of band aids.