Fix removing format for line formats without parentTag

This is to allow to create formats for headers, which are line formats without a parentTag.

Please let me know if there are other concerns I missed with this fix!