Fixed some functions possibly vulnerable for concurrent calls