fix conflict in classes.h with previous PR

Replaces #115 by @malcles.  It's the same except for one manually-removed conflict.