Clone from codeplex.