Bugfixes for IE

Works around JSON not being available in older IE versions