fix len(n_shorted) which should be n_shorted