Fixed to work with both (one-hot, integer-based) labels