Fixed my explosions! (the temperature was dividing by the total number of atoms, instead of the number of moving atoms, which again caused the berendsen thermostat to work wrong)