Good idea about computing magic number; I'll add it, and some tests as well.