Fixed min/maxlabs and arrayoutofbounds issue

In demonstration