Fix to use uniform sampling