Fixes for issues relating to multi-threading, webui, and databases