Adding logging, and type conversions for Databases