rand.c: Careful range checking on `block' and `mp'.