Fixed a bug caused by JavaScript being a bad language