Fix coding issues found by ReSharper