Fix infinite loop in bar metrical analysis
More robust fraction division