Adding BerkeleyDb subject.
Fixing some type errors and incorrect IFDEF annotation.