Some small changes to generic.h