Fixed bug where database connection was disposed before Set publish settings were done.