Fixes yet another NoneType error