Fix UI bugs on Firefox and some tweaks