Fixed bug in triplet_states()