Removed console.dir calls because these break PhoneGap(?)