made several more changes to support running on Android 4.3+