Fix segmentation fault

n must be >= 2