Solving the 'System.NullReferenceException' in .NET Applications