Pack of updates and fixes

What do this functions do? Please write more comments about why is it needed and what task it solves