Fix for when you use the .. contents:: directive.