bug fixes and improved android, by Edward and Neeraj