The last commit won't work correctly. Now, check for NoneType.