fixes issues with router crashes

corrects tests as well. not sure why i didn't do this in the first place