Fixed two bugs exposed by the mcf benchmark