Fixes NoneType not iterable bug