fixes for android 2.3, Firefox OS, and cleanup