Seems that changing $ulevel to $level instead seems to have worked, but then I kept getting "FuckOffAndDiePlease No such channel" which has me thinking that for some reason it is ignoring $chan as it worked when I replaced that with the name of the channel I am testing this in. Not sure why "kick $chan $newnick" isn't working.