Fixed a np.shape vs len() call, line 191