Fixed PVS Studio warnings