Added entities into threads

+ several other minor fixes