Fix for "TypeError: 'NoneType' object is not callable"