Fix database bug; expose null pointer (can't find it)