Minor adjustments towards thread safety