fixed check_simplex and added NaN test