DBObject validity refactored slightly.