As mentioned above, the number 0 is not a valid id, that is why $did(0) is reporting an error. This is intentional and cannot be changed as the dialog code across many routines depends on this value being in a valid range.