Fix js issues. Works in all browsers now. Fix #49

Found a few minutes today, so I fixed this one.