Fix returning NaN for smaller integer values

When beta.pdf() was changed to use log format in f89649 to not return
NaN for large values it introduced a bug where NaN was returned for
smaller integer values.
Now working on 0.0.6