Small adjustments to make it work on Android 2.3