More thread safety, additional functions for eval command