Fixed compilation errors for Xamarin Studio 5. Doesn't work correctly yet.