Minor fixes of code after Resharper's check