Fixes Javascript exceptions

I found a few exceptions on the website that were stopping me from viewing the win graphs and was going to send an email when I realised the site was on github!

So here's a couple of small fixes that should stop exceptions. 

Thanks for the great website :smiley: 

Brice