Fixed code according to CLion inspections