Fix AndroidFramework::Delete() so it doesn't crash anymore and small cleanup.