Fix bugs in demo under FireFox.