some fixes for better compatibility with Firefox