backported a few fixes from more modern presentations