Some modifications (mostly commented out) for testing with Android.