Fixed a few small bugs on initialization and with Firefox.