Reapplied fix from #81.