Fixed a database issue with NoneType.