Fix slow loading of Web UI.
Merge pull request #383 from LipuFei/web-ui-fix

Slow Web UI fix
Fix slow upgrade for DB v19.
Merge pull request #384 from LipuFei/db-upgrade-fix

Fix slow upgrade for DB v19.