Updated to .NET 4.5.1. Cleaned up the code a bit.