Modify pick() to return undef instead of failing.

Making this change allows pick() to be used in more cases where
undef is a valid value.