Fix calc to use with-as statement for scoping the dbManager
instance.