Various fixes for ID management. Border/Padding/Background for instream-foreign-object and external-graphic.