coding violations and compilation warnings fixed (Sergey)