Use dup to ensure stack values do not end up in heap objects