Welcome to the Achaea Forums! Please be sure to read the Forum Rules
I just went through and updated the code a bit. Gave the script its own namespace so that it doesn't conflict with other scripts you may have. It's been giving some other people some problems and that's the only solution I could think of, considering that it works perfectly for me.
ETA: The problem was with the pairsByKeys function. Not everyone has it in as many scripts as I do, so because it was being written and overwritten, I couldn't tell that it being a local function within the script was breaking it.