MIN Check for valid label

This check would have saved me from a long debug session as I had
assumed labels were 0..(K-1) instead of 1..K