Brought in fixes from DatabaseTests