Fix small Javascript bug