Fix add_attributes "p with no text" bug