Fix #89: stun duration
some minor adjustments to random.c