Gender still mistakenly identifies as female due to extra characters when comparing.

Strip out unwanted characters in gender.

Looks like unwanted newline and tab characters are in the gender; this strips them out.