Plugged shallow() in duplicated, as mentioned in #617.