Fixed bug with mass function ranges

Pointed out by Enrico Vesperini