The wrong code path was chosen because the code determined that the BODY already contains an existing paragraph on the end of the content. The fix it to not take the credits element into account when determining if the BODY already contains the paragraphs.