fixed issue with database class when not using a replica set.