Changes to get working in .Net 4.5