Miscellaneous work, mostly on multi-threaded scheme