Fixed reject-sample for nan case