Reworked the fraction extraction algorithm.