Fixed possibly wrong sample because value can be = 0