Fix small NoneType error