I could not figure out the reason for the special case in that function. Tests do not show anything useful.