Fixed some incompatibilities with Firefox and Safari