Fix the bug in remove-nth