Updated for recent DB changes
Increased code coverage
Added tests for types