Code analysis fixes by IDEA