Fixed sampling issues.