Logging fixes; max number of database worker threads can be specified