Fixed two errors with script that were being rendered in IE7 and IE8