Fix scripts for IE9 / Windows Phone, other bug fixes