updated the check function with: * a check for max_index * fixed the tail_index check to compare it to max_index
updated the check function with:
* a check for max_index
* fixed the tail_index check to compare it to max_index

khklau/supernova,khklau/supernova,khklau/supernova