many random.c random.h tweaks