Make class validation more precise (#76)