Use denominator correctly, fixes #144