Fix IE7 compatibility; remove some console.log usages that were used for debugging.