My organization uses 'Last, First' for our display names, so when the Get-GivenName function runs and has to retrieve the information from WMI the last name is returned instead of the first name. The specific command is on line 262:
$GivenName = $DisplayName.Split()[0].Trim()
I can easily remedy that by changing the split to 1:
$GivenName = $DisplayName.Split()[1].Trim()
Not sure if you want to document this somewhere, or find a way to account for differences in formatting between organizations.