Made some fixes to make resharper happy.