Fixed NoneType Errors