Fixed the bug created by switching nth for list-ref