Several fixes for achievement recalculation.