fix badval/nan handling: check PDL::Bad::Status; skip array refs