added missed changes; fixed PVS-Studio warnings