javascript syntax fixes which were causing issues in IE8