NoneType fixes