appcache and some other bug fixes