Added another null pointer check after getting too many null pointers.
Another small db schema adustment